<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<meta name="format-detection" content="telephone=no">
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<title>${title}</title>
<link rel="stylesheet" href="${base}/css/default.css" type="text/css">
<script type="text/javascript" src="${base}/js/jquery-2.1.3.min.js"></script>
<script type="text/javascript">
$(function(){
	//区域选择-显示、隐藏层
	 $('#sa').click(function(){
		$('.mask').toggle();
		$('.sm-area-box').toggle();		
		$('html').toggleClass("ho2"); 
	 });
	 $('.mask').click(function(){
		$(this).hide();
		$('.sm-area-box').hide();
	   $('html').toggleClass("ho2");
	 });
	 $('.sa-r-box span').click(function(){ 
		$('.sm-area-box, .mask').hide();
	   $('html').toggleClass("ho2");
	 });
	//区域选择-选择地区
	$(".sa-r-box").hide();
	$(".sa-l ul li:first").addClass("active").show();
	$(".sa-r-box:first").show();
	$(".sa-l li").click(function() {
		$(".sa-l li").removeClass("active");
		$(this).addClass("active");
		$(".sa-r-box").hide(); 
		var activeTab = $(this).find("span").attr("id");
		//alert(activeTab);
		$(activeTab).fadeIn(0);
	});
	var store = window.localStorage||{};
	if(store['city']!=''){
		$('#sa').val(store['city']);
	}
	if(store['localCity']!=''){
		$('input[name="area"]').val(store['localCity']);
	}
	if(store['localCityType']!=''){
		$('input[name="areaType"]').val(store['localCityType']);
	}
});
</script>
</head>
<body>
<div class="mask"></div>
<header><a href="javascript:history.go(-1)" class="back"><span>返回</span></a><h2>搜索查询</h2></header>
<nav>
  <ul>
    <li class="n1"><a href="${base}/index/index"><cite></cite><span>首页</span></a></li>
    <li class="n2"><a href="${base}/search/index" class="on"><cite></cite><span>搜索</span></a></li>
    <li class="n3"><a href="${base}/subscribe/index"><cite></cite><span>订阅</span></a></li>
    <li class="n4"><a href="${base}/center/index"><cite></cite><span>我的</span></a></li>
  </ul>
</nav>
<div class="main search-jg">
	<div class="tab-2"><a href="${base}/search/index">招标信息</a><a href="${base}/agency/index" class="on">机构信息</a></div>
    <div class="sj-sbox">
    	<div class="sj-sb clearfix">
        	<ul>
                <li class="sj-sb-l"><input type="text" id="sa" placeholder="请选择地区" value="全国" readonly class="fs" /><em></em></li>
                <li class="sj-sb-c"><input name="keywords" type="text" placeholder="请输入关键字" class="ft"></li>
                <li class="sj-sb-r"><input name="" type="button" value="搜索" class="fb" /></li>
            </ul>
        </div>
        <div class="sm-area-box">
            <div class="sa-l">
                <ul>
                	<#list provinceList as province>
			                <li><span id="#tab${province_index}" value="${province.id}">${province.name}</span></li>
			             </#list>
                </ul>
            </div>
            <div class="sa-r">
                <#list citylist as citys>
	               	<div id="tab${citys_index}" class="sa-r-box">
		                <ul>
		                	<#list citys.city as city>
		                    	<li><span value="${city.id}" type="${city.type}">${city.name}</span></li>
		                    </#list>
		                </ul>
	            	</div>
           		</#list>
            </div>
        </div>        
    </div>
    <div class="dli clearfix">
    	<ul class="sea-m-list">
        	
        </ul>
    </div>
    <div class="li-more"><a href="#" title="">上拉加载更多</a></div>
</div>
	<input type="hidden" name="area" />
	<input type="hidden" name="areaType" />
	<script type='text/tmpl' id='itemTmpl'>
		<li>
            	<a href="${base}/agency/detail?id=<!=id!>" title="">
                	<div class="dli-box">
                        <strong><!=name!></strong>
                        <div>
                            <p><span>电话：<!=telephone!></span><span>地址：<!=address!></span></p>
                            <b>招标中心</b>
                        </div>
                    </div>
                </a>
                <div class="favor"><span onclick="tocollect(this)" value="<!=id!>" type="<!=tableName!>" <!if(collections!=0){!>class="sc"<!}!>>收藏</span></div>
            </li>
    </script>
    <script type="text/javascript" src="${base}/js/public/lib/zepto.min.js"></script>
	<script type="text/javascript" src="${base}/js/public/lib/baiduTemplate.js"></script>
	<script type="text/javascript" src="${base}/js/public/lib/config.js"></script>
	<script type="text/javascript" src="${base}/js/public/search/agencylist.js"></script>
	
	<script  type="text/javascript">
	function tocollect(obj){
		var $v=$(obj);
		//console.log($v.attr('value'))
		var id = $v.attr('value');
		var type = $v.attr('type');
		
		$.ajax({
				'url':'${base}/collect/insert',
				'type':'post',
				dataType:'json',
				data:{id:id,type:1},//0是news收藏
				success:function(data){
					alert(data.message);
				}
			});
			$v.toggleClass('sc');
		}
	
	
	</script>
</body>
</html>
